﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MonsterEngine.Interfaces;
using MonsterEngine.Types;
using MonsterEngine.Managers;
using MonsterEngine.Augments;

namespace MonsterEngine.Abilities
{
    public class LifeDrip : IAbilities
    {
        public AbilityType AbilityType
        {
            get;
            set;
        }

        public string Name
        {
            get;
            set;
        }

        public string Description
        {
            get;
            set;
        }

        public int BasePoint
        {
            get;
            set;
        }

        public int AbilityKey
        {
            get;
            set;
        }

        public IFightable AbilityTarget
        {
            get;
            set;
        }

        public DamageManager AbilityDamageManager
        {
            get;
            set;
        }

        public DamageType DamageType
        {
            get;
            set;
        }

        public void DoAbility()
        {
            HealOverTime aug = new HealOverTime(BasePoint);
            aug.WornOff += new WornOffHandler(aug_OnWoreOff);
            if (!AbilityTarget.BuffList.Exists(s => s.GetType().Name == typeof(HealOverTime).Name))
            {
                AbilityTarget.BuffList.Add(aug);
                Console.WriteLine("{0} is causing {1} to heal over time", Name, AbilityTarget.Name);
            }
            else
            {
                Console.WriteLine("{0} is already active", Name);
            }
        }

        public void aug_OnWoreOff()
        {
            Console.WriteLine("{0} has worn off!", Name);
        }
    }
}
